package com.jiaquyun.jcyx.entity

import com.google.gson.annotations.SerializedName
import com.module.lemlin.http.HttpResponseData
import java.io.Serializable


data class CartResponse(
    val data: CartEntity
) : HttpResponseData()

data class CartEntity(
    val goods_list: MutableList<CartGoods>? = null,
    val shop_id: Int,
    val shop_img: String,
    val shop_name: String
)

data class CartGoods(
    val active_price: String,
    val active_type: Int,
    val cart_id: Int,
    val count_tip: Int,
    val goods_id: Int,
    val goods_name: String,
    var goods_num: Int,
    val goods_price: String,
    val image: String,
    val is_new: String,
    val is_show: String,
    val order_purchase_limit: Int,
    val purchase_limit: Int,
    val shop_count: Int,
    val unit: String
) {
    var isSelected: Boolean = false
}

data class CartAddResponse(
    val data: CartAdd
) : HttpResponseData() {
    var position: Int = -1
    var cart_id: Int = 0
    var goods_num: Int = 0
}

data class CartAdd(
    val id: String
)

data class CartActionResponse(
    var data: CartAction
) : HttpResponseData()

data class CartAction(
    @SerializedName("id")
    var cartId: Int = 0,
    var goodsId: Int = 0,
    var goodsNum: Int = 0,
    var position: Int = 0,
    var isSelected: Boolean = false,
    var action: Action
) {
    enum class Action {
        UPDATE, DELETE, INSERT, CLEAR, SELECT_ALL, SELECT_SINGLE
    }
}

data class CartSettlementResponse(
    val data: CartSettlement
) : HttpResponseData()

data class CartSettlement(
    var address: Address?=null,
    val coupon_list: MutableList<Any> = mutableListOf(),
    val delivery_money: String,
    val delivery_time: MutableList<DeliveryTime> = mutableListOf(),
    val discount: Int,
    val free_delivery: String,
    val goods_fee: String,
    val goods_list: MutableList<Goods> = mutableListOf(),
    val is_delivery: Int,
    val money: String,
    val order_delivery_time: String?,
    val order_score_deduction_rate: String,
    val score: Int,
    val shop_id: Int,
    val shop_img: String,
    val shop_name: String,
    val total_num: String,
    val scheduled_delivery_time:String
) : Serializable

data class AddressListResponse(
    val data: MutableList<Address> = mutableListOf()
) : HttpResponseData()

data class Address(
    val consignee: String,
    val full_address: String,
    val id: Int,
    val mobile: String,
    val is_default: Boolean
) : Serializable

data class DeliveryTime(
    val end: String,
    val start: String,
    val time: String
) : Serializable

data class Goods(
    val active_id: Int,
    val cart_id: Int,
    val gift_goods_id: Int,
    val gift_id: Int,
    val gift_money: Int,
    val goods_id: Int,
    val goods_name: String,
    val goods_num: Int,
    val image: String,
    val item_no: String,
    val member_goods_price: String,
    val spec: String,
    val tax_rate: Int,
    val tax_rate_no: String
) : Serializable

